feat: Set up comprehensive Python testing infrastructure with Poetry#15
Open
feat: Set up comprehensive Python testing infrastructure with Poetry#15
Conversation
- Add Poetry configuration with pyproject.toml and migrate dependencies - Configure pytest with coverage reporting (80% threshold) and custom markers - Create organized testing directory structure (tests/, tests/unit/, tests/integration/) - Add shared fixtures in conftest.py for common test data and utilities - Include validation tests to verify infrastructure setup - Update .gitignore with testing artifacts and Claude Code settings - Set up Poetry script commands for running tests (test/tests)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set up Python Testing Infrastructure with Poetry
Summary
This PR establishes a complete testing infrastructure for the PERM project, migrating from requirements.txt to Poetry for dependency management and adding comprehensive testing capabilities.
Changes Made
Package Management
pyproject.tomlwith project metadata and dependenciesrequirements.txtto Poetry formatpoetry run testandpoetry run tests)Testing Configuration
Configured pytest with comprehensive settings in
pyproject.toml:unit,integration,slow)Set up coverage reporting with:
src/)Directory Structure
Shared Testing Utilities
conftest.py:temp_dir: Temporary directory managementmock_config: Mock configuration datasample_hair_data: Generated hair data for testingmock_model_weights: Mock neural network weightssample_image_data: Sample image dataValidation Tests
test_setup_validation.py) to verify:Additional Improvements
Usage Instructions
Running Tests
Test Organization
tests/unit/tests/integration/@pytest.mark.slowfor selective executionWriting Tests
Use the provided fixtures in
conftest.pyfor common test scenarios:Validation Results
All validation tests pass successfully:
unit,integration,slow)Dependencies Added
pytest ^7.4.0- Main testing frameworkpytest-cov ^4.1.0- Coverage reportingpytest-mock ^3.11.1- Mocking utilitiesnumpy ^1.21.0- For test data generationNext Steps
The testing infrastructure is now ready for development. Developers can:
tests/unit/tests/integration/poetry run test🤖 Generated with Claude Code